<?php include template('header','common');?>
<link rel="stylesheet" type="text/css" href="{__ROOT__}template/default/statics/css/guanli-detail.css?v={HD_VERSION}">
<link rel="stylesheet" type="text/css" href="{__ROOT__}template/default/statics/css/studentsManage.css?v={HD_VERSION}">
<div class="container">
	<form class="padding-small" method="post" action='{url("edit",array("formhash"=>FORMHASH))}' name="checkmobile">
    <?php foreach($students as $k => $v){?>
    <div class="content">
		<div class="list">
			<div class="item">
				<img src="{__ROOT__}template/default/statics/img/xue-sheng-xing-ming-.png" alt="">
				<span><input type="text" name="truename[]" class="truename" value="{$v['truename']}" placeholder="请填写真实姓名" /></span>
			</div>
			<div class="item">
				<img src="{__ROOT__}template/default/statics/img/lao-shi-ming-zi-.png" alt="">
				<input type="text" name="teacher_name[]" value="{$v['teacher_name']}" placeholder="请输入校内紧急联络人，建议为班主任">
			</div>
			<div class="item">
				<img src="{__ROOT__}template/default/statics/img/lao-shi-dian-hua-.png" alt="">
				<input type="text" name="teacher_mobile[]" class="teacher_mobile" value="{$v['teacher_mobile']}" placeholder="请输入联络人电话">
			</div>
		</div>
	</div>
	<input type="hidden" name="id[]" value="{$v['id']}" >
    <?php }?>
	<div class="btn-view">
		<button class="btn2" style="width:80%;">修改</button>
	</div>
	</form>
</div>
<script>
$(".btn2").click(function(){
	var istruename=true;
	$(".truename").each(function(){
		if($(this).val() == ''){
			istruename = false;	
		}
	});	
	if(istruename == false){
		alerts('请填写真实姓名');
		return false;
	}
	
	var isteacher_mobile=true;
	var reg = /^(1(([35][0-9])|(47)|[7][0678]|[8][0123456789]))\d{8}$/;
	$(".teacher_mobile").each(function(){
		if($(this).val() && $(this).val().match(reg) ==null){
			isteacher_mobile = false;	
		}
	});
	
	if(isteacher_mobile == false){
		alerts('您输入的电话格式不正确');
		return false;
	}
});
</script>
<?php include template('footer','common');?>
